/************************************************************************************
* SLTableMaintainer.h                                                               *
*                                                                                   *
* Copyright (C) 2011 Varuna L Amachi                                                *
*                                                                                   *
* This program is free software; you can redistribute it and/or modify              *
* it under the terms of the GNU General Public License as published by              *
* the Free Software Foundation; either version 2 of the License, or any             *
* later version.                                                                    *
*                                                                                   *
* This program is distributed in the hope that it will be useful, but               *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY        *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for       *
* more details. You should have received a copy of the GNU General Public           *
* License along with this program; if not, write to the Free Software Foundation,   *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                       *
*                                                                                   *
*************************************************************************************/

#ifndef DBTABLEUTIL_H
#define DBTABLEUTIL_H

#include <QSqlDatabase>

#include "interfaces/IDbMaintainer.h"

class SLTableMaintainer : public IDbMaintainer{
    bool static executeQuery(QSqlDatabase* database, const QString queryString);

public:
    SLTableMaintainer();
    bool createSchema(QSqlDatabase *database = NULL);
    bool maintainCachingTables(QSqlDatabase *database = NULL);
    bool createCollectionTable(QSqlDatabase *database = NULL);
    bool createHistoryTable(QSqlDatabase *database = NULL);
    bool createPlaylistInfoTable(QSqlDatabase *database = NULL);
    bool createPlaylistTable(QSqlDatabase *database = NULL);
    bool createRecentAdditionsTable(QSqlDatabase *database = NULL);
    bool createSettingsTable(QSqlDatabase   *database = NULL);

//    bool isDbExists(QString dbName);
    bool initDb(QString dbName);
    QString dbType();
};

#endif // TABLECREATORUTIL_H
